package com.sys.serviceImpl;
import com.sys.mapper.ClassesMapper;
import com.sys.model.Classes;
import com.sys.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;

@Component
public class ClassesServiceImpl implements ClassesService {
    @Autowired
    private ClassesMapper mapper;

    /*查询全部班级信息*/
    @Override
    public List<Classes> getClassesList(Map requestparamMap) {
        return mapper.getClassesList(requestparamMap);
    }

    /*查询班级信息*/
    @Override
    public Classes getClassesById(int id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Classes> getClassesByTeacher(int tid) {
        return mapper.getClassesByTeacher(tid);
    }

    /*添加班级信息*/
    @Override
    public int insertClasses(Classes classes) {
        return mapper.insertSelective(classes);
    }

    /*删除班级信息*/
    @Override
    public int delClasses(int id) {
        return mapper.deleteByPrimaryKey(id);
    }

    /*修改班级信息*/
    @Override
    public int upClasses(Classes classes) {
        return mapper.updateByPrimaryKeySelective(classes);
    }
}
